import request from '@/utils/request'

// 查询客户列表
export function listUser(data) {
    return request({
        url: '/system/customerInformation/list',
        method: 'get',
        params: data
    })
}

// 获取客户详细信息
export function detailUser(id) {
    return request({
        url: '/system/customerInformation/load?id=' + id,
        method: 'get'
    })
}

// 新建客户
export function addUser(data) {
    return request({
        url: '/system/customerInformation/insert',
        method: 'post',
        data: data
    })
}

// 编辑客户
export function editUser(data) {
    return request({
        url: '/system/customerInformation/update',
        method: 'post',
        data: data
    })
}

// 删除
export function userDelete(id) {
    return request({
        url: '/system/customerInformation/remove?id=' + id,
        method: 'post'
    })
}

// 删除客户
export function deleteUser(id) {
    return request({
        url: '/system/customerInformation/deleteById?id=' + id,
        method: 'get'
    })
}
// 审核
export function approveUser(id, approvalStatus, remark) {
    const data = {
        id,
        approvalStatus,
        remark
    }
    return request({
        url: '/system/customerInformation/check',
        method: 'post',
        data: data
    })
}
// 反审核
export function unApproveUser(id, approvalStatus, remark) {
    const data = {
        id,
        approvalStatus,
        remark
    }
    return request({
        url: '/system/customerInformation/uncheck',
        method: 'post',
        data: data
    })
}
// 启用/禁用
export function enableUser(id, status) {
    const data = {
        id,
        status
    }
    return request({
        url: '/system/customerInformation/disable',
        method: 'post',
        data: data
    })
}